//
//  LZFCommentCell.m
//  LZFBuDieJie
//
//  Created by 梁梓烽 on 16/7/18.
//  Copyright © 2016年 liangzifeng. All rights reserved.
//

#import "LZFCommentCell.h"
#import "LZFCommentItem.h"
#import <UIImageView+WebCache.h>
#import "UIImageView+XMGExtension.h"
#import "LZFUserItem.h"

@interface LZFCommentCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *likeLabel;
@end
@implementation LZFCommentCell

-(void)setComment:(LZFCommentItem *)comment
{
    _comment=comment;
    
    //icon
    [self.iconImageView setHeader:comment.user.profile_image];
    
    //sex
    if (comment.user.sex==@"m") {
        self.sexImageView.image=[UIImage imageNamed:@"Profile_manIcon"];
    }
    else
    {
          self.sexImageView.image=[UIImage imageNamed:@"Profile_womanIcon"];
        
    }
    //name
    self.nameLabel.text=comment.user.username;
    
    //content
    self.contentLabel.text=comment.content;
    //likecont
    self.likeLabel.text=[NSString stringWithFormat:@"%ld",comment.like_count];
    
}

//高度减1,设置分割线
-(void)setFrame:(CGRect)frame
{
    frame.size.height-=1;
    [super setFrame:frame];
}
@end
